package mylab.unitconversion;

public class LengthConverter {
	
	//inches to feet, yards, natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public final static double FeetInchesFactor				 =	12.0;				// 1 foot = 12 inches.
	public final static double YardsInchesFactor			 =	36.0;				// 1 yard = 36 inches.
	public final static double NauticalmilesInchesFactor	 =	72913.386;			// 1 nautical mile = 72913.386 inches.
	public final static double MilesInchesFactor			 =	63360.0;			// 1 mile = 63360 inches.
	public final static double NanometersInchesFactor		 =	254000000.0;		// 1 inch 	= 254000000 nanometers.
	public final static double MicrometersInchesFactor		 =	254000.0;			// 1 inch = 254000 micrometers.
	public final static double MillimetersInchesFactor		 =	25.4;				// 1 inch = 25.4 millimeters.
	public final static double CentimetersInchesFactor		 =	2.54;				// 1 inch = 2.54 centimeters.
	public final static double MetersInchesFactor			 =	39.370079;			// 1 meter = 39.370079 inches.
	public final static double KilometersInchesFactor		 =	39370.07874;		// 1 kilometer = 39370.07874 inches.
	
	
	//feet to yards, natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public final static double YardsFeetFactor				 =	3.0;				// 1 yard = 3 feet.
	public final static double NauticalmilesFeetFactor		 =	6076.0;				// 1 nautical = 6076.0 feet.
	public final static double MilesFeetFactor				 =	5280.0;				// 1 mile = 5280 feet.
	public final static double NanometersFeetFactor			 =	304800000.0;		// 1 foot  = 304800000 nanometers.
	public final static double MicrometersFeetFactor		 =	304800.0;			// 1 foot  = 304800 micrometers.
	public final static double MillimetersFeetFactor		 =	304.8;				// 1 foot  = 304.8 millimeters.
	public final static double CentimetersFeetFactor		 =	30.48;				// 1 foot = 30.48 centimeters.
	public final static double MetersFeetsFactor			 =	3.2808;				// 1 meter = 3.2808 feet.
	public final static double KilometersFeetsFactor		 =	3280.8399;			// 1 kilometer = 3280.8399 feet.
	
	
	//yards to natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public final static double NauticalmilesYardsFactor		 =	2025.3718;			// 1 nautical mile = 2025.3718 yards.
	public final static double MilesYardsFactor			 =	1760.0;				// 1 mile = 1760 yards.
	public final static double NanometersYardsFactor		 =  914400000.0;		// 1 yard = 914400000 nanometers.
	public final static double MicrometersYardsFactor		 =	914400.0;			// 1 yard = 914400 micrometers.
	public final static double MillimetersYardsFactor		 =	914.4;				// 1 yard = 914.4 millimeters.
	public final static double CentimetersYardsFactor		 =	91.44;				// 1 yard = 91.44 centimeter.
	public final static double MetersYardsFactor			 =	0.9144;				// 1 yard = 0.9144 meters.
	public final static double KilometersYardsFactor		 =	0.0009144;			// 1 yard = 0.0009144 kilometers.
	
	
	//nauticalmiles to miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public final static double MilesNauticalmilesFactor		 =	0.868976;			// 1 mile = 0.868976 nautical miles.
	public final static double NanometersNauticalmilesFactor =	1852000000000.0;	// 1 mautical mile = 1852000000000 nanometers.	
	public final static double MicrometerNauticalmilesFactor =	1852000000.0;		// 1 nautical mile = 1852000000 micrometers.
	public final static double MillimetersNauticalmilesFactor=	1852000.0;			// 1 nautical mile = 1852000 millimeters.	 
	public final static double CentimetersNauticalmilesFactor=	185200.0;			// 1 nautical mile = 185200.0 centimeters.
	public final static double MeterNauticalmilesFactor		 =	1852.0;				// 1 nautical mile = 1852.0 meters.
	public final static double KilometersNauticalmilesFactor =	1.852;				// 1 nautical mile = 1.852 kilometers.
	
	
	//miles to nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public final static double NanometersMilesFactor		 =	1609347219000.0;	// 1 mile =	1609347219000.0 nanometers.
	public final static double MicrometersMilesFactor		 =	1609347219.0;		// 1 mile = 1609347219.0 micrometers.
	public final static double MillimetersMilesFactor		 =	1609347.219;		// 1 mile = 1609347.219 millimeters.
	public final static double CentimetersMilesFactor		 =	160934.7219;		// 1 mile = 160934.7219 centimeters.
	public final static double MetersMilesFactor		 	 =	1609.347219;		// 1 mile = 1609.347219 meters.
	public final static double KilometersMilesFactor		 =	1.609347219;		// 1 mile = 1.609347219 kilometers.
	
	
	//nanometers to micrometers, millimeters, centimeters, meters, kilometers.
	public final static double MicrometersNanometersFactor	 =	1000.0;				// 1 micrometer = 1000 nanometers.
	public final static double MillimetersNanometersFactor	 =	1000000.0;			// 1 millimeter = 1000000 nanometers.
	public final static double CentimetersNanometersFactor	 =	10000000.0;			// 1 centimeter = 10000000 nanometers.
	public final static double MetersNanometersFactor		 =	1000000000.0;		// 1 meter		= 1000000000 nanometers.
	public final static double KilometersNanometersFactor	 =	1000000000000.0;	// 1 kilometer  = 1000000000000 nanometers.
			
	
	//micrometers to millimeters, centimeters, meters, kilometers.
	public final static double MillimetersMicroMetersFactor	 =	1000.0;				// 1 millimeter = 1000 micrometers.
	public final static double CentimetersMicroMetersFactor  =	10000.0;			// 1 centimeter	= 10000 micrometers.
	public final static double MetersMicrometersFactor		 =	1000000.0;			// 1 meter		= 1000000 micrometers.
	public final static double KilometersMicrometersFactor	 =  1000000000.0;		// 1 kilometer	= 1000000000 micrometers.
	

	//millimeters to centimeters, meters, kilometers
	public final static double CentimetersMillimetersFactor	 =	0.1;				// 1 millimeter = 0.1 millimeters.
	public final static double MetersMillimetersFactor	 	 =	1000.0;				// 1 meter = 1000 millimeters.
	public final static double KilometersMillimetersFactor	 =	1000000.0;			// 1 kilometer = 1000000 millimeters.
	

	//centimeters to meters, kilometers
	public final static double MetersCentimetersFactor		 =	100.0;				// 1 meter = 100 centimeters.
	public final static double KilometersCentimetersFactor	 =	100000.0;			// 1 kilometer = 100000 centimeters.
	
	
	//meters to kilometers
	public final static double KilometersMetersFactor		 =	1000.0;				// 1 kilometer = 1000 meters.
	
	
	
	//inches to feet, yards, natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public static double inchesToFeet(double value){return value/FeetInchesFactor;}	
	public static double feetToInches(double value){return value*FeetInchesFactor;}
	
	public static double inchesToYards(double value){return value/YardsInchesFactor;}
	public static double yardsToInches(double value){return value*YardsInchesFactor;}
	
	public static double inchesToNauticalmiles(double value){return value/NauticalmilesInchesFactor;}
	public static double nauticalmilesToInches(double value){return value*NauticalmilesInchesFactor;}
	
	public static double inchesToMiles(double value){return value/MilesInchesFactor;}
	public static double milesToInches(double value){return value*MilesInchesFactor;}
	
	public static double inchesToNanometers(double value){return value*NanometersInchesFactor;}
	public static double nanometersToInches(double value){return value/NanometersInchesFactor;}
	
	public static double inchesToMicrometers(double value){return value*MicrometersInchesFactor;}
	public static double micrometersToInches(double value){return value/MicrometersInchesFactor;}
	
	public static double inchesToMillimeters(double value){return value*MillimetersInchesFactor;}
	public static double millimetersToInches(double value){return value/MillimetersInchesFactor;}
	
	public static double inchesToCentimeters(double value){return value*CentimetersInchesFactor;}
	public static double centimetersToInches(double value){return value/CentimetersInchesFactor;}
	
	public static double inchesToMeters(double value){return value/MetersInchesFactor;}
	public static double metersToInches(double value){return value*MetersInchesFactor;}
	
	public static double inchesToKilometers(double value){return value/KilometersInchesFactor;}
	public static double KilometersToInches(double value){return value*KilometersInchesFactor;}
	
	
	//feet to yards, natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public static double feetToYards(double value){return value/YardsFeetFactor;}
	public static double yardsToFeet(double value){return value*YardsFeetFactor;}
	
	public static double feetToNauticalmiles(double value){return value/NauticalmilesFeetFactor;}
	public static double nauticalmilesToFeet(double value){return value*NauticalmilesFeetFactor;}
	
	public static double feetToMiles(double value){return value/MilesFeetFactor;}
	public static double milesToFeet(double value){return value*MilesFeetFactor;}
	
	public static double feetToNanometers(double value){return value*NanometersFeetFactor;}
	public static double nanometersToFeet(double value){return value/NanometersFeetFactor;}
	
	public static double feetToMicrometers(double value){return value*MicrometersFeetFactor;}
	public static double micrometersToFeet(double value){return value/MicrometersFeetFactor;}
	
	public static double feetToMillimeters(double value){return value*MillimetersFeetFactor;}
	public static double millimetersToFeet(double value){return value/MillimetersFeetFactor;}
	
	public static double feetToCentimeters(double value){return value*CentimetersFeetFactor;}
	public static double centimetersToFeet(double value){return value/CentimetersFeetFactor;}
	
	public static double feetToMeters(double value){return value/MetersFeetsFactor;}
	public static double metersToFeet(double value){return value*MetersFeetsFactor;}
	
	public static double feetToKilometers(double value){return value/KilometersFeetsFactor;}
	public static double kilometersToFeet(double value){return value*KilometersFeetsFactor;}
	
	
	
	//yards to natical miles, miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public static double yardsToNauticalmiles(double value){return value/NauticalmilesYardsFactor;}
	public static double nauticalMilesToYards(double value){return value*NauticalmilesYardsFactor;}
	
	public static double yardsToMiles(double value){return value/MilesYardsFactor;}
	public static double milesToYards(double value){return value*MilesYardsFactor;}
	
	public static double yardsToNanometers(double value){return value*NanometersYardsFactor;}
	public static double nanometersToYards(double value){return value/NanometersYardsFactor;}
	
	public static double yardsToMicrometers(double value){return value*MicrometersYardsFactor;}
	public static double micrometersToYards(double value){return value/MicrometersYardsFactor;}
	
	public static double yardsToMillimeters(double value){return value*MillimetersYardsFactor;}
	public static double millimetersToYards(double value){return value/MillimetersYardsFactor;}
	
	public static double yardsToCentimeters(double value){return value*CentimetersYardsFactor;}
	public static double centimetersToYards(double value){return value/CentimetersYardsFactor;}
	
	public static double yardsToMeters(double value){return value*MetersYardsFactor;}
	public static double metersToYards(double value){return value/MetersYardsFactor;}
	
	public static double yardsToKilometers(double value){return value*KilometersYardsFactor;}
	public static double kilometersToYards(double value){return value/KilometersYardsFactor;}
	
	
	//nauticalmiles to miles, nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public static double nauticalmilesToMiles(double value){return value/MilesNauticalmilesFactor;}
	public static double milesToNauticalmiles(double value){return value*MilesNauticalmilesFactor;}
	
	public static double nauticalmilesToNanometers(double value){return value*NanometersNauticalmilesFactor;}
	public static double nanometersToNauticalmiles(double value){return value/NanometersNauticalmilesFactor;}
	
	public static double nauticalmilesToMicrometers(double value){return value*MicrometerNauticalmilesFactor;}
	public static double micrometersToNauticalmiles(double value){return value/MicrometerNauticalmilesFactor;}
	
	public static double nauticalmilesToMillimeters(double value){return value*MillimetersNauticalmilesFactor;}
	public static double millimetersToNauticalmiles(double value){return value/MillimetersNauticalmilesFactor;}
	
	public static double nauticalmilesToCentimeters(double value){return value*CentimetersNauticalmilesFactor;}
	public static double centimetersToNauticalmiles(double value){return value/CentimetersNauticalmilesFactor;}
	
	public static double nauticalmilesToMeters(double value){return value*MeterNauticalmilesFactor;}
	public static double metersToNauticalmiles(double value){return value/MeterNauticalmilesFactor;}
	
	public static double nauticalmilesToKilometers(double value){return value*KilometersNauticalmilesFactor;}
	public static double kilometersToNauticalmiles(double value){return value/KilometersNauticalmilesFactor;}
	
	
	
	//miles to nanometers, micrometers, millimeters, centimeters, meters, kilometers
	public static double milesToNanometers(double value){return value*NanometersMilesFactor;}
	public static double nanometersToMiles(double value){return value/NanometersMilesFactor;}
	
	public static double milesToMicrometers(double value){return value*MicrometersMilesFactor;}
	public static double micrometersToMiles(double value){return value/MicrometersMilesFactor;}
	
	public static double milesToMillimeters(double value){return value*MillimetersMilesFactor;}
	public static double millimetersToMiles(double value){return value/MillimetersMilesFactor;}
	
	public static double milesToCentimeters(double value){return value*CentimetersMilesFactor;}
	public static double centimetersToMiles(double value){return value/CentimetersMilesFactor;}
	
	public static double milesToMeters(double value){return value*MetersMilesFactor;}
	public static double metersToMiles(double value){return value/MetersMilesFactor;}
	
	public static double milesToKilometers(double value){return value*KilometersMilesFactor;}
	public static double kilometersToMiles(double value){return value/KilometersMilesFactor;}
	
	
	
	//nanometers to micrometers, millimeters, centimeters, meters, kilometers.
	public static double nanometersToMicrometers(double value){return value/MicrometersNanometersFactor;}
	public static double micrometersToNanometers(double value){return value*MicrometersNanometersFactor;}
	
	public static double nanometersToMillimeters(double value){return value/MillimetersNanometersFactor;}
	public static double millimetersToNanometers(double value){return value*MillimetersNanometersFactor;}
	
	public static double nanometersToCentimeters(double value){return value/CentimetersNanometersFactor;}
	public static double centimetersToNanometers(double value){return value*CentimetersNanometersFactor;}
	
	public static double nanometersToMeters(double value){return value/MetersNanometersFactor;}
	public static double metersToNanometers(double value){return value*MetersNanometersFactor;}
	
	public static double nanometersToKilometers(double value){return value/KilometersNanometersFactor;}
	public static double kilometersToNanometers(double value){return value*KilometersNanometersFactor;}
	
	

	//micrometers to millimeters, centimeters, meters, kilometers.
	public static double micrometersToMillimeters(double value){return value/MillimetersMicroMetersFactor;}
	public static double millimetersToMicrometers(double value){return value*MillimetersMicroMetersFactor;}
	
	public static double micrometersToCentimeters(double value){return value/CentimetersMicroMetersFactor;}
	public static double centimetersToMicrometers(double value){return value*CentimetersMicroMetersFactor;}
	
	public static double micrometersToMeters(double value){return value/MetersMicrometersFactor;}
	public static double metersToMicrometers(double value){return value*MetersMicrometersFactor;}
	
	public static double micrometersToKilometers(double value){return value/KilometersMicrometersFactor;}
	public static double kilometersToMicrometers(double value){return value*KilometersMicrometersFactor;}
	
	
	
	//millimeters to centimeters, meters, kilometers
	public static double millimetersToCentimeters(double value){return value*CentimetersMillimetersFactor;}
	public static double centimetersToMillimeters(double value){return value/CentimetersMillimetersFactor;}
	
	public static double millimetersToMeters(double value){return value/MetersMillimetersFactor;}
	public static double metersToMillimeters(double value){return value*MetersMillimetersFactor;}
	
	public static double millimetersToKilometers(double value){return value/KilometersMillimetersFactor;}
	public static double kilometersToMillimeters(double value){return value*KilometersMillimetersFactor;}
	
	
	//centimeters to meters, kilometers
	public static double centimetersToMeters(double value){return value/MetersCentimetersFactor;}
	public static double metersToCentimeters(double value){return value*MetersCentimetersFactor;}
	
	public static double centimetersToKilometers(double value){return value/KilometersCentimetersFactor;}
	public static double kilometersToCentimeters(double value){return value*KilometersCentimetersFactor;}
	
	//meters to kilometers
	public static double metersToKilometers(double value){return value/KilometersMetersFactor;}
	public static double kilometersToMeters(double value){return value*KilometersMetersFactor;}
}
